<ul id="jMenu"  class="ui-corner-all">
        <?php foreach($items as $cha):
            if($cha['MaloaiCha'] == 0)
            {
        ?>
            <li>
                <a id="<?php echo $cha['MaLoaiSP'];?>" class="fNiv ui-corner-all"><?php echo $cha['TenLoaiSP']?></a>
        		<ul>
                    <?php 
                        foreach($items as $con):
                        if($con['MaloaiCha'] == $cha['MaLoaiSP'])
                        {
                    ?>
        			<li id="<?php echo $con['MaLoaiSP'];?>" class="child"><a><?php echo $con['TenLoaiSP'];?></a></li>
                    <?php
                        }
                        endforeach;
                    ?>
      		    </ul>
            </li>
        <?php }
            endforeach;
        ?>
</ul>
<script>
//Menu
$("#jMenu").jMenu();

//Click Menu
$('.fNiv').click(function(){
    var id = $(this).attr('id');
    $.ajax({
        type: 'POST',
        url: '<?=base_url('index.php/sanpham_controller/hienthisanpham/')?>',
        data :{id : id},
        success: function(data){
            $('.content').html(data);
        }
    });
    $('.formError').remove();
    $('#ui-datepicker-div').remove();
});
$('.child').click(function(){
    var id = $(this).attr('id');
    $.ajax({
        type: 'POST',
        url: '<?=base_url('index.php/sanpham_controller/hienthisanpham/')?>',
        data :{id : id},
        success: function(data){
            $('.content').html(data);
        }
    });
    $('.formError').remove();
    $('#ui-datepicker-div').remove();
});
</script>